from PyQt5.QtWidgets import QLabel, QPushButton, QTextEdit, QLineEdit, QVBoxLayout, QHBoxLayout, QFrame, QWidget
from PyQt5.QtCore import Qt

def create_gui_layout():
    # 摄像头画面
    image_label = QLabel()
    image_label.setAlignment(Qt.AlignCenter)
    image_label.setFixedSize(640, 480)
    button = QPushButton('按住说话')
    button.setMinimumHeight(90)
    button.setMinimumWidth(90)
    button.setMaximumHeight(90)
    button.setMaximumWidth(90)
    button.setStyleSheet('''
        QPushButton {
            background: #4f8cff;
            color: white;
            border: none;
            border-radius: 40px;
            font-size: 10px;
            font-weight: normal;
        }
        QPushButton:hover {
            background: #357ae8;
        }
    ''')
    # 聊天相关控件
    chat_display = QTextEdit()
    chat_display.setReadOnly(True)
    chat_display.setStyleSheet("background: #f8fafc; border-radius: 8px;")
    chat_display.setMinimumWidth(400)
    chat_display.setMinimumHeight(220)
    chat_input = QLineEdit()
    chat_input.setPlaceholderText("请输入内容...")
    chat_input.setMinimumHeight(38)
    chat_input.setMinimumWidth(220)
    send_button = QPushButton('发送')
    send_button.setMinimumHeight(38)
    send_button.setMinimumWidth(80)
    # 聊天输入区布局
    chat_input_layout = QHBoxLayout()
    chat_input_layout.addWidget(chat_input, stretch=4)
    chat_input_layout.addWidget(send_button, stretch=1)
    chat_input_layout.setSpacing(8)
    # 右侧聊天区卡片
    right_card = QFrame()
    right_card.setObjectName("Card")
    right_layout = QVBoxLayout(right_card)
    right_layout.addWidget(chat_display, stretch=5)
    right_layout.addLayout(chat_input_layout, stretch=1)
    right_layout.setSpacing(16)
    right_layout.setContentsMargins(18, 18, 18, 18)
    right_card.setMinimumWidth(440)
    # 左侧摄像头区卡片
    left_card = QFrame()
    left_card.setObjectName("Card")
    left_layout = QVBoxLayout(left_card)
    left_layout.addWidget(image_label)
    btn_center_widget = QWidget()
    btn_center_layout = QHBoxLayout(btn_center_widget)
    btn_center_layout.addStretch(1)
    btn_center_layout.addWidget(button)
    btn_center_layout.addStretch(1)
    btn_center_layout.setContentsMargins(0, 0, 0, 0)
    left_layout.addWidget(btn_center_widget)
    left_layout.setSpacing(18)
    left_layout.setContentsMargins(18, 18, 18, 18)
    left_card.setMinimumWidth(680)
    # 主体左右布局
    main_layout = QHBoxLayout()
    main_layout.addWidget(left_card, stretch=7)
    main_layout.addWidget(right_card, stretch=5)
    main_layout.setSpacing(32)
    main_layout.setContentsMargins(32, 32, 32, 32)
    return {
        "main_layout": main_layout,
        "image_label": image_label,
        "button": button,
        "chat_display": chat_display,
        "chat_input": chat_input,
        "send_button": send_button
    } 